import { login, logout, getInfo } from '@/api/login'

const useStore = defineStore(
    'ApplyDetail',
    {
        state: () => ({
            // 用户列表
            applyType: null,
            formData: {},
            detail: {},
            relItems: []
        }),
        actions: {
            setDetailData(data) {
                this.applyType = data.applyType;
                this.formData = data.formData;
                this.detail = {...data};
                this.relItems = data.relItems;
            },
            getApplyType() {
                return this.applyType;
            },
            getFormData() {
                if (!this.formData) {
                    return {};
                }
                return this.formData;
            },
            getDetailData() {
                return this.detail;
            },
            getRelItems() {
                return this.relItems
            }
        }
    })

export default useStore
